package com.summer.main;

public class ThreadTest1 {
	
	public static void main(String[] args) {
		System.out.println("主线程名："+Thread.currentThread().getName());
		Helper helper = new Helper("主线程");
		Thread thread = new Thread(helper);
//		helper.run();
		thread.setName("从线程");
		thread.start();
	}
	
	public static class Helper implements Runnable{
		private String msg;
		
		public Helper(String msg){
			this.msg = msg;
		}
		
		public void run() {
			System.out.println("从线程名："+Thread.currentThread().getName());
			System.out.println("消息来自："+msg);
		}
		
	}
	
}
